package domain;

import domain.cms.CmsHomePage;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

import javax.persistence.Entity;
import javax.persistence.OneToOne;

@Entity
public class MyConfiguration extends AbstractEntity {

    private String imageDirectory;
    private String templateDirectory;
    private String contentInvetoryDir;
    private String domainName;
    private String xmlDirectory;
    private String mainCSS = "";

    private String administratorEmail = "topservis.test@gmail.com";
    private String accountActivationMailSubject = "Aktivace účtu";
    private String passwordResetRequestMailSubject = "Žádost o reset hesla";
    private String passwordResetMailSubject = "Reset hesla";
    private String orderMailSubject = "Objednávka";
    private String registrationMailSubject = "Registrační mail";
    private String outputEncoding = "utf-8";
    private String inputEncoding = "utf-8";

    public String getOutputEncoding() {
        return outputEncoding;
    }

    public void setOutputEncoding(String outputEncoding) {
        this.outputEncoding = outputEncoding;
    }

    public String getInputEncoding() {
        return inputEncoding;
    }

    public void setInputEncoding(String inputEncoding) {
        this.inputEncoding = inputEncoding;
    }

    public String getAccountActivationMailSubject() {
        return accountActivationMailSubject;
    }

    public void setAccountActivationMailSubject(String accountActivationMailSubject) {
        this.accountActivationMailSubject = accountActivationMailSubject;
    }

    public String getPasswordResetRequestMailSubject() {
        return passwordResetRequestMailSubject;
    }

    public void setPasswordResetRequestMailSubject(String passwordResetRequestMailSubject) {
        this.passwordResetRequestMailSubject = passwordResetRequestMailSubject;
    }

    public String getPasswordResetMailSubject() {
        return passwordResetMailSubject;
    }

    public void setPasswordResetMailSubject(String passwordResetMailSubject) {
        this.passwordResetMailSubject = passwordResetMailSubject;
    }

    public String getOrderMailSubject() {
        return orderMailSubject;
    }

    public void setOrderMailSubject(String orderMailSubject) {
        this.orderMailSubject = orderMailSubject;
    }

    public String getRegistrationMailSubject() {
        return registrationMailSubject;
    }

    public void setRegistrationMailSubject(String registrationMailSubject) {
        this.registrationMailSubject = registrationMailSubject;
    }

    @OneToOne
    @Cascade(CascadeType.ALL)

    CmsHomePage cmsHomePage = new CmsHomePage();

    public String getContentInvetoryDir() {
        return contentInvetoryDir;
    }

    public void setContentInvetoryDir(String contentInvetoryDir) {
        this.contentInvetoryDir = contentInvetoryDir;
    }

    public String getDomainName() {
        return domainName;
    }

    public void setDomainName(String domainName) {
        this.domainName = domainName;
    }

    public String getXmlDirectory() {
        return xmlDirectory;
    }

    public void setXmlDirectory(String XmlDirectory) {
        this.xmlDirectory = XmlDirectory;
    }

    public String getImageDirectory() {
        return imageDirectory;
    }

    public CmsHomePage getCmsHomePage() {
        return cmsHomePage;
    }

    public void setCmsHomePage(CmsHomePage cmsHomePage) {
        this.cmsHomePage = cmsHomePage;
    }

    public void setImageDirectory(String imageDirectory) {
        if (!imageDirectory.endsWith("/")) {
            imageDirectory = imageDirectory + "/";
        }
        this.imageDirectory = imageDirectory;
    }

    public String getTemplateDirectory() {
        return templateDirectory;
    }

    public void setTemplateDirectory(String templateDirectory) {
        if (!templateDirectory.endsWith("/")) {
            templateDirectory = templateDirectory + "/";
        }
        this.templateDirectory = templateDirectory;
    }


    public MyConfiguration() {
    }

    public String getAdministratorEmail() {
        return administratorEmail;
    }

    public void setAdministratorEmail(String administratorEmail) {
        this.administratorEmail = administratorEmail;
    }

    public String getMainCSS() {
        return mainCSS;
    }

    public void setMainCSS(String mainCSS) {
        this.mainCSS = mainCSS;
    }
}

